package com.shop.domain.commission;


import com.alibaba.fastjson.annotation.JSONField;
import com.shop.jpa.domain.BaseDomain;
import com.shop.jpa.support.JpaConst;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.Where;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * <p>实体类</p>
 * <p>Table: t_commission_role - 分佣角色表</p>
 * @author generator
 * @date 2020-12-05 03:32:01
 */
@ApiModel("CommissionRole 分佣角色表")
@Data
@Entity
@Table(name="t_commission_role")
@SQLDelete(sql = "update t_commission_role set is_deleted = 1 where id = ?")
@Where(clause = JpaConst.WHERE_CLAUSE_NOT_DELETED)
@DynamicInsert(true)
@DynamicUpdate(true)
public class CommissionRole extends BaseDomain implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @ApiModelProperty(value = "id", hidden = true)
    @Column(name = "id")
    @JSONField(serialize = false)
    private Long id;

    /**
     * 编号（数字越大级别越高）
     */
    @Column(name = "code")
    @ApiModelProperty("编号（数字越大级别越高）")
    private Integer code;

    /**
	 * 名称
	 */
	@Column(name = "name")
    @ApiModelProperty("名称")
    private String name;

    /**
	 * 图标
	 */
	@Column(name = "icon")
    @ApiModelProperty("图标")
    private String icon;

    /**
	 * 介绍
	 */
	@Column(name = "introduction")
    @ApiModelProperty("介绍")
    private String introduction;

    /**
     * 升级所需支付金额
     */
    @Column(name = "upgrade_pay_amount")
    @ApiModelProperty("升级所需支付金额")
    private Integer upgradePayAmount;

    /**
	 * 升级直推人数
	 */
	@Column(name = "upgrade_direct_num")
    @ApiModelProperty("升级直推人数")
    private Integer upgradeDirectNum;

    /**
     * 状态 0 未启用 1 启用
     */
    @Column(name = "status")
    @ApiModelProperty("状态 0 未启用 1 启用")
    private Integer status;

    /**
	 * 创建时间
	 */
	@Column(name = "create_time")
    @ApiModelProperty("创建时间")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    /**
	 * 最后一次更新时间
	 */
	@Column(name = "update_time")
    @ApiModelProperty("最后一次更新时间")
    @JSONField(serialize=false)
    private Date updateTime;

    /**
	 * 是否删除 0：不删除   1：删除
	 */
	@Column(name = "is_deleted")
    @ApiModelProperty("是否删除 0：不删除   1：删除")
    @JSONField(serialize=false)
    private Integer isDeleted;
}